<?php

use yii\db\Migration;
use yii\db\Schema;

/**
 * Class m181114_024147_ADD_FIELD_SUPPLIER
 */
class m181114_024147_ADD_FIELD_SUPPLIER extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn('{{supplier}}', 'email', Schema::TYPE_STRING. "(255) NULL COMMENT '邮箱' AFTER city ");

        $this->addColumn('{{supplier}}', 'url', Schema::TYPE_STRING. "(255) NULL COMMENT '网址' AFTER email ");

        $this->addColumn('{{invoice}}', 'payment_date', Schema::TYPE_DATE. " NOT NULL COMMENT '预计付款时间' AFTER download_time ");
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        echo "m181114_024147_ADD_FIELD_SUPPLIER cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m181114_024147_ADD_FIELD_SUPPLIER cannot be reverted.\n";

        return false;
    }
    */
}
